<template>
  <div>
    <!-- Preloader Starts -->
    <div class="preloader">
      <div class="spinner"></div>
    </div>
    <!-- Preloader End -->

    <!-- Header Area Starts 有背景图片-->
    <header class="header-area">
      <div class="header-top">
        <div class="container">
          <div class="row">
            <div class="col-lg-2">
              <div class="logo-area">
                <router-link to="/"><img src="assets/images/logo-light.png" alt="logo"></router-link>
              </div>
            </div>
            <div class="col-lg-10">
              <!-- 顶部导航栏在缩放为手机模式下的右上角三条杠-->
              <div class="custom-navbar">
                <span></span>
                <span></span>
                <span></span>
              </div>
              <div class="main-menu main-menu-light">
                <ul>
                  <li class="active">
                    <router-link to="/">首页</router-link>
                  </li>
                  <li>
                    <router-link to="/category">分类</router-link>
                  </li>
                  <li><a href="#">笔记/博客</a>
                    <ul class="sub-menu">
                      <li>
                        <router-link to="/blogHome">首页</router-link>
                      </li>
                      <li>
                        <router-link to="/blogDetail">最近</router-link>
                      </li>
                    </ul>
                  </li>
                  <li class="menu-btn">
                    <a href="javascript:void(0);" @click="contact()" class="login">联系</a>
                    <a href="#" class="template-btn">导航</a>
                  </li>
                </ul>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="page-title text-center">
        <div class="container">
          <div class="row">
            <div class="col-md-6 offset-md-3">
              <h2>说明</h2>
              <p>个人网站，仅提供交流！项目开源地址在“联系”页卡，欢迎指教！</p>
            </div>
          </div>
        </div>
      </div>
    </header>
    <!-- Header Area End -->

    <router-view></router-view>

    <!-- Footer Area Starts -->
    <footer class="footer-area section-padding">
      <div class="footer-widget">
        <div class="container">
          <div class="row">
            <div class="col-xl-5 offset-xl-1 col-lg-6">
              <div class="single-widget-home mb-5 mb-lg-0">
                <h3 class="mb-4"></h3>
                <ul>
                  <li class="mb-2"> <a target="_blank"
                      href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=50010502002641">
                      <img src="baiantubiao.png" height="20rem" width="20rem" />
                      渝公网安备 50010502002641号
                    </a> </li>
                  <li class="mb-2">
                    &nbsp;<i class="fa fa-dribbble"></i> &nbsp;开源地址
                    <a target="_blank"  href="https://gitee.com/snowfrost/book-web">https://gitee.com/snowfrost/book-web</a>
                    <br/>
                    <a target="_blank"  href="https://gitee.com/snowfrost/stage">https://gitee.com/snowfrost/stage</a>
                  </li>
                </ul>
              </div>
            </div>
            <div class="col-xl-5 offset-xl-1 col-lg-6">
              <div class="single-widget-home mb-5 mb-lg-0">
                <h3 class="mb-4"></h3>
                <ul>
                  <li class="mb-2">
                    <a href="https://beian.miit.gov.cn/" target="_blank">渝ICP备2021009040号-1</a>
                  </li>
                  <li class="mb-2">
                    网站访问量{{visit}}
                    <i class="fa fa-heart-o" aria-hidden="true"></i>
                    by <a href="http://ouhenry.top" target="_blank">Ou Henry</a>
                  </li>
                </ul>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="footer-copyright">
        <div class="container">
          <div class="row">
            <div class="col-lg-8 col-md-6">
              <span>
              </span>
            </div>
          </div>
        </div>
      </div>
    </footer>
    <!-- Footer Area End -->

  </div>
</template>
<script>
  import axios from 'axios'

  export default {
    name: 'app',
    data() {
      return {
        visit: 0
      }
    },
    // 刷新页面后增加一次访问量
    mounted: function() {
      var _this = this;
      axios.post('/manage/web/visit')
        .then(function(response) {
          _this.visit = response.data.data
        })
        .catch(function(error) {
          console.log(error);
        });
    },
    methods: {
      // 重复路由
      contact: function() {
        if (this.$router.currentRoute.name === "contact") {
          return
        }
        this.$router.push({
          name: 'contact',
        });
      }
    }
  }
</script>
